package top.xierongsheng.user.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Range;
import top.xierongsheng.user.dto.groups.Create;
import top.xierongsheng.user.dto.groups.Update;
import top.xierongsheng.user.dto.groups.UpdateStatus;

import jakarta.validation.constraints.*;

import java.io.Serial;
import java.io.Serializable;

@Data
@Schema(description = "角色数据Dto")
@Accessors(chain = true)
public class RoleDto implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    @Schema(description = "角色ID")
    @NotBlank(message = "角色id不能为空", groups = {Update.class, UpdateStatus.class})
    private String id;

    @Schema(description = "角色名称")
    @NotBlank(message = "角色名称不能为空", groups = {Create.class, Update.class})
    private String name;

    @Schema(description = "角色英文名称")
    @NotBlank(message = "角色英文名称不能为空", groups = {Create.class, Update.class})
    private String roleName;

    @Schema(description = "角色描述")
    @NotBlank(message = "角色描述不能为空", groups = {Create.class, Update.class})
    private String description;

    @Schema(description = "角色状态")
    @NotNull(message = "status值不能为空", groups = {UpdateStatus.class})
    @Range(max = 2, min = 1, message = "status值应为1-2", groups = {UpdateStatus.class})
    private Integer status;
}
